const { regClass } = Laya;
import { PhysicalCollisionRTBase } from "./PhysicalCollisionRT.generated";

@regClass()
export class PhysicalCollisionRT extends PhysicalCollisionRTBase {
    onEnable(): void {
        let bTopRB = this.bTop.getComponent(Laya.StaticCollider);
        let bTopShapes = bTopRB.shapes;
        (bTopShapes[0] as Laya.BoxShape2D).width = this.bTop.width;
        bTopRB.shapes = bTopShapes;

        let bBottomRB = this.bBottom.getComponent(Laya.StaticCollider);
        let bBottomShapes = bBottomRB.shapes;
        (bBottomShapes[0] as Laya.BoxShape2D).width = this.bBottom.width;
        bBottomRB.shapes = bBottomShapes;

        let bRightRB = this.bRight.getComponent(Laya.StaticCollider);
        let bRightShapes = bRightRB.shapes;
        (bRightShapes[0] as Laya.BoxShape2D).height = this.bRight.height;
        bRightRB.shapes = bRightShapes;

        let bLeftRB = this.bLeft.getComponent(Laya.StaticCollider);
        let bLeftShapes = bLeftRB.shapes;
        (bLeftShapes[0] as Laya.BoxShape2D).height = this.bLeft.height;
        bLeftRB.shapes = bLeftShapes;
    }
}